/**
 * <p>
 *
 * @Author：Roy
 * @Description：设备管理
 * @Date：Create by 2023-11-30 18:51:39
 */
import request from '@/utils/request'

const device = {
  // 分页查询设备管理
  queryList(data) {
    return request({
      url: '/energy-carbon/ecp-admin/device/queryPage',
      method: 'post',
      data
    })
  },
  // 新增设备管理
  add(data) {
    return request({
      url: '/energy-carbon/ecp-admin/device/add',
      method: 'post',
      data
    })
  },
  detail(data) {
    return request({
      url: '/energy-carbon/ecp-admin/device/detail',
      method: 'post',
      data
    })
  },
  // 编辑设备管理
  update(data) {
    return request({
      url: '/energy-carbon/ecp-admin/device/update',
      method: 'post',
      data
    })
  },
  // 保存运行参数
  saveRunningParameter(data) {
    return request({
      url: '/energy-carbon/ecp-admin/device/saverunningparameter',
      method: 'post',
      data
    })
  },
  //获取物联网设备状态
  getDeviceStatus(deviceCode) {
    return request({
      url: '/energy-carbon/ecp-admin/device/getDeviceStatus',
      method: 'GET',
      params: { deviceCode }
    })
  },
  //查询设备关联产品关联的模型信息
  modelList(id) {
    return request({
      url: '/energy-carbon/ecp-admin/device/modellist',
      method: 'POST',
      data: { id }
    })
  },
  // 删除设备管理
  deleteById(data) {
    return request({
      url: '/energy-carbon/ecp-admin/device/deleteById',
      method: 'post',
      data
    })
  },
  // 启用禁用
  enableOrDisable(data) {
    return request({
      url: '/energy-carbon/ecp-admin/device/enableOrDisable',
      method: 'post',
      data
    })
  },
  // 批量删除设备管理
  batchDelete(data) {
    return request({
      url: '/energy-carbon/ecp-admin/device/batchDelete',
      method: 'post',
      data
    })
  },
  existDevice(param) {
    return request({
      url: '/energy-carbon/ecp-admin/device/exist',
      method: 'GET',
      params: param
    })
  }
}

export default device
